#include <bits/stdc++.h>

int n;

inline int norm(int a) {
    a -= 1;
    a %= n;
    if (a < 0) a += n;
    return a + 1;
}

int query(int a) {
    std::cout << "? " << norm(a) << std::endl;
    int res; std::cin >> res;
    return res;
}

void answer(int a, int b) {
    std::cout << "! " << norm(a) << ' ' << norm(b) << std::endl;
    return;
}

void work() {
    std::cin >> n;
    int q1 = query(1), q2 = query(2);
    if (q1 == q2) {
        int l = 1, r = q1, mid;
        while (l < r) {
            int mid = (l + r + 1) >> 1;
            if (query(1 + mid) == q1) l = mid;
            else r = mid - 1;
        }
        l += 1;
        if (q1 <= n / 2) {
            answer(l - q1, l);
        } else {
            int d = n - q1;
            int x = l + (n - d - d + 1) / 2;
            int y = x + d;
            answer(x, y);
        }
    } else
        if (q1 - q2 == 1) {
            int d = n - q1;
            int x = 2 + (q2 - d) / 2;
            int y = x + d;
            answer(x, y);
        } else
            if (q1 - q2 == -1) {
                int d = n - q2;
                int x = 1 - (q1 - d) / 2;
                int y = x - d;
                answer(x, y);
            } else
                if (q1 - q2 == 2) {
                    int d = query(1 + q1 / 2);
                    int x = 1 + (q1 - d) / 2;
                    int y = x + d;
                    answer(x, y);
                } else
                    if (q1 - q2 == -2) {
                        int d = query(2 - q2 / 2);
                        int x = 2 - (q2 - d) / 2;
                        int y = x - d;
                        answer(x, y);
                    }

                return;
}

int main() {
    std::ios::sync_with_stdio(false);
    int T; std::cin >> T; while (T--) work();
    return 0;
}
